<div class="row searchLineWrap">
	<form class="form-horizontal" method="post" action="${cxt!}/admin/settlement/index" id="searchForm">
	  <div class="col-md-12">
		  <div class="row">
		    <div class="col-md-4">
		      <div class="form-group">
		         <label  class="col-md-3 control-label">${_res["customer.username"]}</label>
		         <div class="col-md-9">
		            <input type="text" class="form-control" name="customer.l_username" placeholder="${_res['customer.username']}" value="${paramMap['customer.l_username']}"/>
		         </div>
		       </div>
		    </div>
		    
		    <div class="col-md-4">
		      <div class="form-group">
		         <label  class="col-md-3 control-label">${_res["system.startdate"]}</label>
		         <div class="col-md-9">
		            <input type="text" class="laydate-icon form-control layer-date" onclick="laydate()" name="settlement.gt_actualdate"  placeholder="${_res['system.startdate']}" value="${paramMap['settlement.gt_actualdate']}"/>
		         </div>
		       </div>
		    </div>
		    <div class="col-md-4">
		      <div class="form-group">
		         <label class="col-md-3 control-label">${_res["system.enddate"]}</label>
		         <div class="col-md-9">
		             <input type="text" class="laydate-icon form-control layer-date" onclick="laydate()" name="settlement.le_actualdate"  placeholder="${_res['system.enddate']}" value="${paramMap['settlement.le_actualdate']}"/>
		         </div>
		       </div>
		     </div>
		   
		  </div>
		  <div class="row">
		    <div class="col-md-4">
		         <div class="form-group">
		           <label class="col-md-3 control-label">${_res["settlement.status"]}</label>
		           <div class="col-md-9">
		               <#dict type="select" class="form-control" name="settlement.f_status"  dictCode="SETTLEMENT_STATUS" defaultValue="${paramMap['settlement.f_status']}"/><br>
		           </div>
		       </div>
		    </div>
		    
		    <div class="col-md-3"></div>
		     
		    <div class="col-md-3">
		        <div class="form-group">
		          <button type="button" class="btn btn-primary pull-right" onclick="ajaxForm('content','searchForm')">
		          <i class="fa fa-search m-l-sm m-r-xs"></i>${_res["system.search"]}</button>
		        </div>
		    </div>
		  </div>
	  </div>
	</form>
</div>

<div class="row searchLineWrap">
	<% if(hasPrivilegeUrl("downloadsettlementdetail")){ %>
		<p><a href="javascript:void(0);" onClick="downloaddetail();" class="btn btn-primary pull-left">${_res["system.export"]}</a><div class="clearfix"></div></p>
	<% } %>
	<table class="table table-bordered table-hover">
	    <thead>
	        <tr>
	            <th>${_res["customer.username"]}</th>
	            <th>${_res["settlement.amount"]}</th>
	            <th>${_res["settlement.status"]}</th>
	            <th>${_res["settlement.expecteddate"]}</th>
	            <th>${_res["settlement.actualdate"]}</th>
	            <th>${_res["settlement.operater"]}</th>
	            <th>${_res["system.memo"]}</th>
	            <th>${_res["system.operator"]}</th>
	          </tr>
	    </thead>
	    <tbody>
	        <%for (settlement in settlementList!){%>
	         <tr class="gradeC">
	            <td><#cust customerId="${settlement.userid!}"/></td>
	            <td>${settlement.amount!}</td>
	            <td><#dict type="lable"  value="${settlement.status!}"  dictCode="SETTLEMENT_STATUS" /></td>
	            <td>${settlement.expecteddate!,dateFormat="yyyy-MM-dd"}</td>
	            <td>${settlement.actualdate!,dateFormat="yyyy-MM-dd HH:mm"}</td>
	            <td><#dict type="lable" table="customer" filedName="username" filedValue="id" value="${settlement.settleby!}" /></td>
	             <td>${settlement.memo!}</td>
	            <td>
	               <button type="button" class="btn btn-sm btn-link" onClick="ajaxContent('/admin/settlement/view/${settlement.id!}')">${_res["settlement.settlement.detail"]}</button>
	               <button type="button" class="btn btn-sm btn-link" onClick="ajaxContent('/admin/settlement/edit/${settlement.id!}')">${_res["settlement.operater.settlement"]}</button>
	            </td>
	       </tr>
	       <%}%>
	    </tbody>
	</table>
	<div id="splitPageDiv">
		<#page formId="searchForm"/>
	</div>
	<#nav />
</div>

<script>
 function downloaddetail(){
	var url = "/admin/settlement/export";
	var data = "filename=settlement";
	ajaxDownload(url,"searchForm",data);
	return true;
  };
</script>